window.onload = function(){
    // 吸顶灯效果
    var header=document.getElementById("header");
    var headerTop=header.offsetTop;
    window.onscroll = function(){
        var backTop = document.documentElement.scrollTop || document.body.scrollTop;
        if(backTop>headerTop){
            header.style.position = "fixed";
            header.style.top = "0";
            header.style.left = "0";
            header.style.zIndex = "100"; //层级在最上
        }else{
            header.style.position = "";
        }
    }
}